-
Notifications
You must be signed in to change notification settings - Fork 71
Get plot data for prepostfit experiments #438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Humble apologies for taking so long to getting to this PR @lpoug. I've unfortunately not had much time to spend on CausalPy as I'd have liked, but hoping to catch up with the backlog. There are currently a couple of issues with the remote checks. I'm hoping to get these resolved in #437, at which point I'll test this out locally and give feedback if necessary before we can merge this :) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
==========================================
+ Coverage 94.40% 94.53% +0.12%
==========================================
Files 31 31
Lines 1985 2068 +83
==========================================
+ Hits 1874 1955 +81
- Misses 111 113 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Absolutely no problem whatsoever @drbenvincent! Let me know when the time comes, I'll be around 😄 |
Hi @lpoug. I pushed some changes, can you make sure to pull the latest version? I'll try to review this in the next few days :) |
Hey there @drbenvincent. Just to be sure, are you waiting on anything on my side? |
Apologies for the delay! Just dropping in some review comments now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the slow review on this. My bad.
Overall this looks good. I've suggested some minor changes. Other than that the main thing is to update the tests to ensure this functionality remains working into the future.
Could you add new tests to test_integration_pymc_examples.py
and test_integration_skl_examples.py
. I imagine we can just test that we successfully get back a dataframe from calling result.get_plot_data
on the experiments that you've implemented so far. You could optionally test that the contents of that dataframe is as expected, e.g. has the desired columns.
In theory an ultra pedantic person might want to test that we get an exception when calling the get_plot_data
on experiments that.
Because this PR involves additional methods, can you run make uml
. This should update the UML diagram that we include in CONTRIBUTING.md
Sorry again about the latency on this review.
…ata_ols to _get_plot_data_ols, bayesian_plot to _bayesian_plot, and ols_plot to _ols_plot
No problem at all! I was just starting to get worried about something that still needed to be done on my end 😅 Thank you for the reviews. I've added links to the commits directly in your comments. 6a6face (renaming of functions) Regarding tests, I have added them in 97f0d79 I have not added anything yet to test that we get an exception when calling the Finally, I have updated the diagrams in 0edca77 Let me know if these changes look good or not or if you had anything else in mind! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think we are very nearly there :) Thanks for adding in the tests.
It could be prudent to rename the *_hdi_lower
and *_hdi_upper
columns to include the numerical hdi_prob
as a percentage. For example if hdi_prob=0.8
then the columns could be labelled as *_hdi_lower_80
and *_hdi_upper_80
. That way there is much less scope to make a mistake like generating 80% HDI's but forgetting that and thinking that you generated 95% HDI's for example. I think that should be pretty simple to do in _get_plot_data_bayesian
or _get_plot_data_ols
.
Should also be pretty simple to resolve the merge conflicts - it's just the updated uml images as far as I can see.
Could you also update the docstring of the tests? At the moment they list out what is tested, so you can just flag up that it tests the functionality of plot_data
. I'm not sure we'll carry on doing that in the future if the number of tests gets large, but let's keep up with it for the moment.
…ted tests accordingly, and updated tests' docstring
I made the changes for dynamic naming of Regarding the merge conflicts, to be honest I'm not sure what I need to do on my side? Could you enlighten me, please? Thanks! |
Hi @lpoug. I've sorted the conflicting files and done a few small things. I'm just noticing that at the moment the rendered docs obscure the allowable args/kwargs. So we have this: ![]() Same situation if we look at an actual experiment class: I will have a quick play with this to see if we can expose the parameter information to the user in the docs. I think the easiest way is to revert a previous suggestion and make |
…add arviz to intersphinx_mapping
Any other final changes @lpoug, or are you happy to merge this now? Looks like there might just be a quick test coverage issue to deal with, but I'm sure we can get that done between us. |
Success with code coverage and all tests passing. Hope you don't mind that I carried this over the finish like @lpoug. Sorry the process was a little slow, it will be faster on your next PR 😀 |
Amazing thank you @drbenvincent! Glad to have been a part of this 😄 Looking forward for the next, even more challenging one! |
.get_plot_data()
functionNote: First time doing a proper PR so not sure if all pre-requisites are here.
📚 Documentation preview 📚: https://causalpy--438.org.readthedocs.build/en/438/